<?php
defined('BASEPATH') OR exit('No direct script access allowed');
header("Content-type: text/html; charset=utf-8");
class Go extends CI_Controller{
//    var $login_user;
    function __construct(){
        parent::__construct();
        $this->load->helper('cookie');
    }
    function display($view, $data = []) {
        $this->load->view('home/'.$view,$data);
    }
    function index(){
        $data['base_url'] = site_url('home/index/1').'?1=1';
        $list = db_get_list('article', 'xcid=8 and zk=1 and state=1', '', '', 'id asc', 'id,title,go_title');
        $data['list'] = $list;
        $data['xcid'] = 'go';
        $this->display('go', $data);
    }
    function help($xcid = 0){
        $where = 'xcid in(14,15,16) and state=1';
        if ($xcid > 0) {
            $where = 'xcid='.$xcid.' and state=1';
        }
        $list = db_get_list('article', $where, '', '', 'id desc');
        $data['list'] = $list;
        $data['xcid'] = 13;
        $this->display('help', $data);
    }
    function help_v($id = 0){
        if ($id > 0) {
            $data['article'] = $article = article_get($id);
            article_view_update($id, $article['view']);
            $data['rec'] = [];
            $data['dj'] = [];
            $data['xg'] = [];
            $data['xcid'] = $article['cid'];
            $this->display('code_v', $data);
        } else {
            redirect('go/help');
        }
    }
}